/*
	The directives starting with # below ensures that this file is read by the compiler only once
	even if it is #included several times. It is call an "include guard"
*/
#ifndef CART_H_
#define CART_H_

//other types
//#include "Date.h"				//uncomment once you have added the type definition
#include "Chrono.h"
#include <string>
#include <sstream>
using namespace std;
using namespace Chrono;

struct Cart {
public:
	//data

	// constructors
	Cart () {}
	Cart(int ca_id, int cu_id, Date date)
			:cart_id(ca_id), cust_id(cu_id), cart_purchase_date(date){}

   // utility functions
	string display() const
			{
				//cart display format
				stringstream sline (stringstream::in | stringstream::out);
				sline << cart_id << "\t\t" << cust_id << "\t\t" << cart_purchase_date.year() << "\t" << cart_purchase_date.month() << "\t" << cart_purchase_date.day();
				return sline.str();
			}
			
	string write()
		{
				//address display format
				stringstream sline (stringstream::in | stringstream::out);
				sline << cart_id << " " << cust_id << "\t" << cart_purchase_date.year() << "\t" << cart_purchase_date.month() << "\t" << cart_purchase_date.day()<<"\n";
				return sline.str();
		}
	
	// getter functions
	int getCartId() const {return cart_id;}
	int getCustId() const {return cust_id;}
	Date getPurchaseDate() const{return cart_purchase_date;} //RBJ add new getter

	
private:
   //constants

   // private data
	int cart_id;
	int cust_id;
	Date cart_purchase_date;	//uncomment once you have added the type definition
};


#endif //CART_H_